<%@ page import="java.util.Enumeration" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
 <h2>获取HTTP请求头信息</h2>
  <table width="100%" border="1" align="center">
     <tr style="background-color: #949494">
          <th>参数名称</th>
          <th>参数值</th>
     </tr>
      <%
        Enumeration headerNames=request.getHeaderNames();
        while (headerNames.hasMoreElements()){
          String paramName = (String) headerNames.nextElement();
          out.print("<tr><td>"+paramName+"</td>\n");
          String paramValue =request.getHeader(paramName);
          out.print("<td>"+paramValue+"</td></tr>\n");
        }
      %>
  </table>
</body>
</html>
